package cn.com.mdx.sort.practice.nutsbolts;

/**
 * <p> 混合物：螺母和螺帽的混合物
 *
 * @author ：huangy
 * @date ：Created in 2020/9/25 3:27 下午
 */
public class Mixture {

    /**
     * 螺母
     */
    public static final int NUT = 1;

    /**
     * 螺帽
     */
    public static final int BOLT = 2;

    /**
     * 类型：1：螺母
     * 类型：2：螺帽
     */
    private final int type;

    /**
     * 尺寸
     */
    private final int size;

    public Mixture(int type, int size) {
        this.type = type;
        this.size = size;
    }

    public int getType() {
        return type;
    }

    public int getSize() {
        return size;
    }

    public String toString() {
        String typeStr = "螺母";
        if (type == BOLT) typeStr = "螺帽";
        return "当前元件：" + typeStr + "，尺寸：" + size;
    }
}
